From b8e6a27b60bc447aad33152a69a3589a99028ed7 Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 20 Oct 2006 14:44:58 +0000 Subject: [PATCH] Add explict unlink of position for realtime KML. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2416 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/kml.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gpsbabel/kml.c b/gpsbabel/kml.c index 3d6f94765..92a5e7fa8 100644 --- a/gpsbabel/kml.c +++ b/gpsbabel/kml.c @@ -278,6 +278,17 @@ kml_wr_deinit(void) fclose(ofd); if (posnfilenametmp) { +#if __WIN32__ + /* + * This is gross. + * Windows does not offer an atomic rename; we must + * explictly remove the destination here which exposes + * a window where a polled reader of this file could find + * the file to be missing. Windows readers will simply + * have to retry on this case. + */ + unlink(posnfilename); +#endif rename(posnfilenametmp, posnfilename); xfree(posnfilenametmp); posnfilenametmp = NULL; -- 2.30.2